package com.xgpro.pc.manage.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.xgpro.common.controller.BaseController;
import com.xgpro.common.results.ResponseResult;
import com.xgpro.pc.manage.service.FirstPageService;

import java.util.List;
import java.util.Map;

/**
 * @author tx
 * @version 1.0
 * @date 2019/11/28 21:54
 */
@RestController
@RequestMapping("/firstPage")
@CrossOrigin(allowCredentials = "true")
public class FirstPageController extends BaseController {
	@Autowired
	private FirstPageService firstPageService;

	/**
	 * 首页导师数
	 * 
	 * @return
	 */
	@RequestMapping("/teacherNums")
	public ResponseResult teacherNums() {
		return ResponseResult.ok(firstPageService.teacherNums());
	}

	/**
	 * 首页课程数
	 * 
	 * @return
	 */
	@RequestMapping("/courseNums")
	public ResponseResult courseNums() {
		return ResponseResult.ok(firstPageService.courseNums());
	}

	/**
	 * 导师上课时长排行
	 * 
	 * @return
	 */
	@RequestMapping("/courseTimeSort")
	public ResponseResult courseTimeSort() {
		return ResponseResult.ok(firstPageService.courseTimeSort());
	}

	/**
	 * 课程参与人数排行
	 * 
	 * @return
	 */
	@RequestMapping("/courseStudentNum")
	public ResponseResult courseStudentNum() {
		return ResponseResult.ok(firstPageService.courseStudentNum());
	}

	/**
	 * 课程种类分布
	 * @return
	 */
	@RequestMapping("/courseKind")
	public ResponseResult courseKind(){
		return ResponseResult.ok(firstPageService.courseKind());
	}

	/**
	 * 折线图: 学员公司级,部门级听课时长排行
	 * @return
	 */
	@RequestMapping("/courseDeptSort")
	public ResponseResult courseDeptSort(){
		return ResponseResult.ok(firstPageService.courseDeptSort());
	}
}
